﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Text;

namespace HZ.DrugTrade.Web.Admin
{
    public partial class Default : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        { //版本号
            ltrVersion.Text = Constants.Version;
        }

        /// <summary>
        /// 根据浏览器类型生成 DOCTYPE
        /// </summary>
        /// <returns></returns>
        protected string GetDOCTYPE()
        {
            string strDocType = "";
            string strIE = Request.ServerVariables["HTTP_USER_AGENT"].ToString().Trim();
            string strVersion = strIE.Substring(strIE.IndexOf("MSIE") + 5, 1);
            if (strVersion == "6")
            {
                strDocType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
            }
            return strDocType;
        }

        public string GetLink()
        {
            try
            {
                string strRoleID = CurrentAccount.GetUser().UserRole.RoleID;
                if (strRoleID == "01")
                {
                    return "CallFunc('Hospitals/defaultContent.aspx','FORM',null);";
                }
                if (strRoleID == "02" || strRoleID == "05")
                {
                    return "CallFunc('Enterprise/defaultContent.aspx','FORM',null);";
                } 
                if (strRoleID == "03")
                {
                    return "CallFunc('Admin/defaultContent.aspx','FORM',null);";
                }
                return "javascript:void(0);";
            }
            catch (Exception ex)
            {
                return "javascript:void(0);";
            }
        }
    }
}
